/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.ArrayList;
import java.util.Comparator;

/**
 * <p>Project: javaseapp - Demo
 * <p>Powered by webrx On 2021-08-09 15:52:41
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 16
 */
public class Demo {
    public static void main(String[] args) {
        //var st = new Student();
        //System.out.println(st);

        //int[] a1 = new int[3];
        //System.out.println(a1[0]);
        var list = new ArrayList<User>();
        list.add(new User(1, "李四", 30));
        list.add(new User(2, "张三", 20));
        list.add(new User(3, "安三九", 50));
        list.add(new User(4, "赵七", 70));
        list.add(new User(5, "李丽", 90));
        list.add(new User(6, "王五", 95));
        list.add(new User(7, "张三丰", 83));
        System.out.println(list);

        list.sort((a, b) -> b.getScore() - a.getScore());

        System.out.println(list);

        list.sort(Comparator.comparing(User::getName));
        System.out.println(list);

    }
}
